home *** CD-ROM | disk | FTP | other *** search
- /* setmode.c, from page 367 of Turbo C Bible */
- #include <stdio.h>
- #include <io.h>
- #include <fcntl.h>
- main ()
- {
- /* Set mode of stdout to O_BINARY (binary mode) */
- if (setmode (fileno (stdout), O_BINARY) == -1)
- {
- perror ("setmode failed");
- }
- else
- {
- printf ("stdout is in binary mode now.\n");
- printf ("Notice how this output looks.\n");
- }
- }